package com.smarthome.domain.enums;
/**
 * 
* @ClassName: HKIpcResidenceDoorStatus
* @Description: 海康门口机状态
* @author cyj
* @date 2015年10月9日 下午9:13:08
*
 */
public enum HKIpcResidenceDoorStatus {

	NORMAL("0","正常"),CPU("1","CPU占用率太高"),HARDWARE("2","硬件错误");
	
	private String code;
	private String name;
	
	private HKIpcResidenceDoorStatus(String code, String name) {
		this.code = code;
		this.name = name;
	}

	
	
	public String getCode() {
		return code;
	}



	public void setCode(String code) {
		this.code = code;
	}



	public String getName() {
		return name;
	}



	public void setName(String name) {
		this.name = name;
	}



	public static String getNameByCode(String code) {
		HKIpcResidenceDoorStatus[] statusArray = HKIpcResidenceDoorStatus.values();
		for(HKIpcResidenceDoorStatus status:statusArray) {
			if(status.getCode().equals(code)) {
				return status.getName();
			}
		}
		return "";
	}
}
